
using System;

using Gnome;
using Gdk;

namespace MyCanvas
{
	public class MyCanvas:Gnome.Canvas
	{
	
		Gnome.CanvasGroup _root ;
	
		public MyCanvas()
		{
			Console.WriteLine("Inicializando Canvas");
			this._root = base.Root();
		
			this._root.CanvasEvent += new Gnome.CanvasEventHandler(CanvasEvent);
		
		}
		
		public Gnome.CanvasGroup Root()
		{
			Console.WriteLine("Devolviendo mi Root");
			return this._root;
		}
		
		public void CanvasEvent(object obj, Gnome.CanvasEventArgs args)
		{
			//Console.WriteLine("Canvas Event General");
			EventButton ev = new EventButton (args.Event.Handle);
			switch (ev.Type) 
			{
				case EventType.MotionNotify:
					//Console.WriteLine("Mouse General");
					break;
			}
		}
		
		public void addFigure(Figura fig)
		{
			Console.WriteLine("Agregando Figura "+fig.toString());
			this.draw(fig);
		}
		
		private void draw(Figura fig)
		{
			fig.draw(this);
		}
	}
}
